package com.tsd.jxc.buy.service;

import com.tsd.core.vo.PageBean;
import com.tsd.jxc.buy.entity.JxcBuyOrder;
import com.tsd.jxc.buy.entity.JxcBuyOrderExt;
import com.tsd.jxc.buy.entity.JxcBuyReturnBillExt;
import com.tsd.jxc.buy.vo.JxcBuyStockInfoVo;
import com.tsd.jxc.vo.JxcSettingVo;
import com.tsd.system.entity.SysUser;
import com.tsd.system.entity.SysUserExt;

import java.util.List;
import java.util.Map;

/**
 * 描述：JxcBuyOrder服务实现层接口
 *
 * @author Hillpool
 * @date 2022/07/29 15:00:45
 */
public interface JxcBuyOrderService {

    /**
     * 描述：根据id获取JxcBuyOrder
     *
     * @param id
     */
    JxcBuyOrder getJxcBuyOrderById(Long id) throws Exception;

    /**
     * 描述：根据sid获取JxcBuyOrder
     *
     * @param sid
     */
    JxcBuyOrderExt queryBySid(String sid) throws Exception;

    /**
     * 描述：根据sid列表删除JxcBuyOrder
     *
     * @param list
     */
    void deleteJxcBuyOrders(List<String> list, SysUser opUser) throws Exception;

    /**
     * 描述：保存或更新JxcBuyOrder
     *
     * @param record
     * @param opUser
     */
    void saveJxcBuyOrder(JxcBuyOrderExt record, SysUser opUser) throws Exception;

    /**
     * 描述：根据params分页查询JxcBuyOrder
     *
     * @param params
     * @param page
     */
    List<JxcBuyOrderExt> findJxcBuyOrders(Map<String, Object> params, PageBean page) throws Exception;

    /**
     * 描述：根据params分页查询JxcBuyOrder
     *
     * @param params
     */
    List<JxcBuyOrderExt> findJxcBuyOrders(Map<String, Object> params) throws Exception;

    void changeJxcBuyOrderAuditState(List<String> sidList, Integer state, SysUserExt opUser) throws Exception;

    void cancelJxcBuyOrder(List<String> sidList, SysUserExt opUser) throws Exception;

    int genJxcBuyOrder2InBill(List<String> sidList, SysUserExt opUser) throws Exception;

    void genJxcBuyOrder2ReturnBill(List<String> sidList, SysUserExt opUser) throws Exception;

    JxcBuyReturnBillExt getJxcBuyOrder2ReturnBillData(String sid) throws Exception;

    Integer genJxcFinanceAccountDetail4Buy(List<String> sidList, SysUserExt opUser) throws Exception;

    /**
     * 描述：导出包含明细
     *
     * @param params
     * @param page
     * @return
     */
    List<JxcBuyOrderExt> findJxcBuyOrdersIncludeDetail(Map<String, Object> params, PageBean page);

    List<JxcBuyOrderExt> queryJxcBuyOrderData4Print(List<String> sidList) throws Exception;

    List<JxcBuyStockInfoVo> findJxcBuyOrders4Stock(Map<String, Object> params, PageBean page) throws Exception;

    List<JxcBuyOrderExt> findJxcBuyOrders4Select(Map<String, Object> params, PageBean page) throws Exception;

    void importJxcBuyOrder(JxcBuyOrderExt orderExt, SysUserExt opUser) throws Exception;

    JxcBuyOrderExt getJxcSale2BuyData(List<String> saleOrderList, List<String> saleOrderDetailList) throws Exception;

    List<String> saveJxcBuyOrder4Sale2Buy(JxcBuyOrderExt orderExt, JxcSettingVo settingVo, SysUserExt opUser) throws Exception;

}
